
struct3.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <print>:
}A;

A tmp = {10, '0'};

void print(void)
{
   0:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
   4:	910003fd 	mov	x29, sp
        printf("tmp.a = %d tmp.b = %c\n", tmp.a, tmp.b);	// tmp.a = 10 tmp.b = 0
   8:	90000000 	adrp	x0, 0 <print>
   c:	91000000 	add	x0, x0, #0x0
  10:	b9400001 	ldr	w1, [x0]
  14:	90000000 	adrp	x0, 0 <print>
  18:	91000000 	add	x0, x0, #0x0
  1c:	39401000 	ldrb	w0, [x0, #4]
  20:	2a0003e2 	mov	w2, w0
  24:	90000000 	adrp	x0, 0 <print>
  28:	91000000 	add	x0, x0, #0x0
  2c:	94000000 	bl	0 <printf>

        printf("&tmp = %p &tmp.a = %p &tmp.b = %p\n", 
  30:	90000000 	adrp	x0, 0 <print>
  34:	91000001 	add	x1, x0, #0x0
  38:	90000000 	adrp	x0, 0 <print>
  3c:	91000002 	add	x2, x0, #0x0
  40:	90000000 	adrp	x0, 0 <print>
  44:	91000003 	add	x3, x0, #0x0
  48:	90000000 	adrp	x0, 0 <print>
  4c:	91000000 	add	x0, x0, #0x0
  50:	94000000 	bl	0 <printf>
                        (unsigned long)(void *)&tmp, 
                        (unsigned long)(void *)&tmp.a,
                        (unsigned long)(void *)&tmp.b);	// &tmp = 0x804995c &tmp.a = 0x804995c &tmp.b = 0x8049960

        printf("sizeof tmp = %d sizeof tmp.a = %d sizeof tmp.b = %d\n", 
  54:	90000000 	adrp	x0, 0 <print>
  58:	91000000 	add	x0, x0, #0x0
  5c:	d2800023 	mov	x3, #0x1                   	// #1
  60:	d2800082 	mov	x2, #0x4                   	// #4
  64:	d2800101 	mov	x1, #0x8                   	// #8
  68:	94000000 	bl	0 <printf>
                        sizeof(A),
                        sizeof(int),
                        sizeof(char));	// sizeof tmp = 8 sizeof tmp.a = 4 sizeof tmp.b = 1;  A=8字节为为了结构体对齐
}
  6c:	d503201f 	nop
  70:	a8c17bfd 	ldp	x29, x30, [sp], #16
  74:	d65f03c0 	ret

0000000000000078 <priBit>:

void priBit(int t)
{
  78:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  7c:	910003fd 	mov	x29, sp
  80:	b9001fa0 	str	w0, [x29, #28]
        int i = 32;
  84:	52800400 	mov	w0, #0x20                  	// #32
  88:	b9002fa0 	str	w0, [x29, #44]

        printf("t = %d\n", t);
  8c:	90000000 	adrp	x0, 0 <print>
  90:	91000000 	add	x0, x0, #0x0
  94:	b9401fa1 	ldr	w1, [x29, #28]
  98:	94000000 	bl	0 <printf>
        for (; i > 0; i--)
  9c:	1400000b 	b	c8 <priBit+0x50>
        {
                printf("%d", (t >> i) & 0x0001);
  a0:	b9402fa0 	ldr	w0, [x29, #44]
  a4:	b9401fa1 	ldr	w1, [x29, #28]
  a8:	1ac02820 	asr	w0, w1, w0
  ac:	12000001 	and	w1, w0, #0x1
  b0:	90000000 	adrp	x0, 0 <print>
  b4:	91000000 	add	x0, x0, #0x0
  b8:	94000000 	bl	0 <printf>
        for (; i > 0; i--)
  bc:	b9402fa0 	ldr	w0, [x29, #44]
  c0:	51000400 	sub	w0, w0, #0x1
  c4:	b9002fa0 	str	w0, [x29, #44]
  c8:	b9402fa0 	ldr	w0, [x29, #44]
  cc:	7100001f 	cmp	w0, #0x0
  d0:	54fffe8c 	b.gt	a0 <priBit+0x28>
        }
        printf("\n");
  d4:	52800140 	mov	w0, #0xa                   	// #10
  d8:	94000000 	bl	0 <putchar>
}
  dc:	d503201f 	nop
  e0:	a8c37bfd 	ldp	x29, x30, [sp], #48
  e4:	d65f03c0 	ret

00000000000000e8 <_main>:

int _main()
{
  e8:	a9be7bfd 	stp	x29, x30, [sp, #-32]!
  ec:	910003fd 	mov	x29, sp
        int *p = NULL;
  f0:	f9000fbf 	str	xzr, [x29, #24]

        print();
  f4:	94000000 	bl	0 <print>
        p = (int *)&tmp;
  f8:	90000000 	adrp	x0, 0 <print>
  fc:	91000000 	add	x0, x0, #0x0
 100:	f9000fa0 	str	x0, [x29, #24]
        priBit(*p);
 104:	f9400fa0 	ldr	x0, [x29, #24]
 108:	b9400000 	ldr	w0, [x0]
 10c:	94000000 	bl	78 <priBit>
        priBit(*(p + 1));	// 指向下一个字段;  48 = '0'
 110:	f9400fa0 	ldr	x0, [x29, #24]
 114:	91001000 	add	x0, x0, #0x4
 118:	b9400000 	ldr	w0, [x0]
 11c:	94000000 	bl	78 <priBit>
}
 120:	d503201f 	nop
 124:	a8c27bfd 	ldp	x29, x30, [sp], #32
 128:	d65f03c0 	ret

000000000000012c <main>:
        char name[20];
        int num;
};

int main()
{
 12c:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
 130:	910003fd 	mov	x29, sp
        void *p = NULL;
 134:	f90017bf 	str	xzr, [x29, #40]
        struct stu a={"li main",5};
 138:	90000000 	adrp	x0, 0 <print>
 13c:	91000000 	add	x0, x0, #0x0
 140:	910043a2 	add	x2, x29, #0x10
 144:	aa0003e3 	mov	x3, x0
 148:	a9400460 	ldp	x0, x1, [x3]
 14c:	a9000440 	stp	x0, x1, [x2]
 150:	f9400860 	ldr	x0, [x3, #16]
 154:	f9000840 	str	x0, [x2, #16]
        p=&a;
 158:	910043a0 	add	x0, x29, #0x10
 15c:	f90017a0 	str	x0, [x29, #40]
        printf(" %s %d  \n",( (struct stu *) p )->name,( (struct stu *) p )->num);	// li main 5 
 160:	f94017a1 	ldr	x1, [x29, #40]
 164:	f94017a0 	ldr	x0, [x29, #40]
 168:	b9401402 	ldr	w2, [x0, #20]
 16c:	90000000 	adrp	x0, 0 <print>
 170:	91000000 	add	x0, x0, #0x0
 174:	94000000 	bl	0 <printf>

		_main();
 178:	94000000 	bl	e8 <_main>

		return 0;
 17c:	52800000 	mov	w0, #0x0                   	// #0
}
 180:	a8c37bfd 	ldp	x29, x30, [sp], #48
 184:	d65f03c0 	ret
